/*
 * Component.java
 *
 * Created on Dec 22, 2011
 *
 * Copyright (c) 2011 Artur Rataj.
 *
 * This code is distributed under the terms of the GNU Library
 * General Public License, either version 3 of the license or, at
 * your option, any later version.
 */

package pl.gliwice.iitis.spatialnn.network;

/**
 * A network's component -- either a membrane or a neuron.
 * 
 * @author Artur Rataj
 */
public abstract class Component {
    /**
     * Creates a new instance of <code>Component</code>.
     */
    public Component() {
    }
    /**
     * Adds an input.
     * 
     * @param target target of the input to add
     */
    public abstract void addInput(AbstractTarget target);
    /**
     * Removes an input at a given index.
     * 
     * @param index index of the input to remove
     */
    public abstract void removeInput(int index);
    /**
     * Removes an output component at a given index.
     * 
     * @param index index of the output component to remove
     */
    public abstract void removeOutputComponent(int index);
    /**
     * Returns the array with inputs.
     * 
     * @return an array with inputs of this component.
     */
    public abstract AbstractTarget[] getInputs();
    /**
     * Returns the array with output components.
     * 
     * @return an array with output components of this component.
     */
    public abstract AbstractTarget[] getOutputComponents();
//    /**
//     * Returns a new target, representing this component.
//     * 
//     * @return a new target
//     */
//    public abstract AbstractTarget asTarget();
    /**
     * After a network is constructed, call this to enable propagation through this
     * component.
     * 
     * @param network a network, to which this component belongs
     */
    public abstract void sync(Network network);
}
